package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysAppMedicine;
import com.ruoyi.system.mapper.SysAppMedicineMapper;
import com.ruoyi.system.service.ISysAppMedicineService;
import com.ruoyi.common.core.text.Convert;

/**
 * 药物管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-08-31
 */
@Service
public class SysAppMedicineServiceImpl implements ISysAppMedicineService 
{
    @Autowired
    private SysAppMedicineMapper sysAppMedicineMapper;

    /**
     * 查询药物管理
     * 
     * @param id 药物管理ID
     * @return 药物管理
     */
    @Override
    public SysAppMedicine selectSysAppMedicineById(Long id)
    {
        return sysAppMedicineMapper.selectSysAppMedicineById(id);
    }

    /**
     * 查询药物管理列表
     * 
     * @param sysAppMedicine 药物管理
     * @return 药物管理
     */
    @Override
    public List<SysAppMedicine> selectSysAppMedicineList(SysAppMedicine sysAppMedicine)
    {
        return sysAppMedicineMapper.selectSysAppMedicineList(sysAppMedicine);
    }

    /**
     * 新增药物管理
     * 
     * @param sysAppMedicine 药物管理
     * @return 结果
     */
    @Override
    public int insertSysAppMedicine(SysAppMedicine sysAppMedicine)
    {
        sysAppMedicine.setCreateTime(DateUtils.getNowDate());
        return sysAppMedicineMapper.insertSysAppMedicine(sysAppMedicine);
    }

    /**
     * 修改药物管理
     * 
     * @param sysAppMedicine 药物管理
     * @return 结果
     */
    @Override
    public int updateSysAppMedicine(SysAppMedicine sysAppMedicine)
    {
        return sysAppMedicineMapper.updateSysAppMedicine(sysAppMedicine);
    }

    /**
     * 删除药物管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysAppMedicineByIds(String ids)
    {
        return sysAppMedicineMapper.deleteSysAppMedicineByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除药物管理信息
     * 
     * @param id 药物管理ID
     * @return 结果
     */
    @Override
    public int deleteSysAppMedicineById(Long id)
    {
        return sysAppMedicineMapper.deleteSysAppMedicineById(id);
    }
}
